<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body {
            margin: 50px;
            border: 2px solid black;
            width: 346px;
            height: 346px;

        }
        a {
            display: block;
            width: 100px;
            height: 100px;
            text-decoration: none;
            text-align: center;
            line-height: 100px;
            color: white;
            background-color: deeppink;
            font-size: 18px;
            text-align: center;
            border: 1px solid black;
            position: relative;
        }
        a:hover {
            background-color: blue;
        }
        .d1 {
            display: inline-block;
            margin-left: 20px;
            margin-top: 20px;
          
        }
        .d2 {
            display: inline-block;
            float: right;
            margin-right: 20px;
            margin-top: 20px;
            
        }
        .d3 {
            display: inline-block;
            margin-left: 20px;
           
        }
        .d4 {
            display: inline-block;
            float: right;
            margin-right: 20px;
            
        }
        .d5 {
            margin-left: 122px;
            
        }
      
    </style>
</head>
<body>
<div class="d1">
    <a href="">链接1</a>
</div>
<div class="d2">
    <a href="">链接2</a>
</div>
<div class="d5">
    <a href="">链接5</a>
</div>
<div class="d3">
    <a href="">链接3</a>
</div>
<div class="d4">
    <a href="">链接4</a>
</div>

</body>
</html>